package
{
	import flash.utils.Dictionary;
	
	import com.bourre.structures.Range;
	import com.kairos.engine.RTEvent;
	import com.kairos.utils.monitor.AbstractMonitorField;	

	public class ParticleRTField extends AbstractMonitorField
	{
		private var _oDictionary : Dictionary
		
		public function ParticleRTField(name : String="Untitled", target:Dictionary=null, unit:String="ms", col:Number=0xffffff, dr:Range=null)
		{
			_oDictionary = target;
			super(name, _count(), unit, dr, col);
		}
		private function _count () : Number
		{
			var n : Number = 0;
			for each( var i : * in _oDictionary )
			{
				n++;
			}	
			return n;
		}	
		public override function registerValue(e:RTEvent):void
		{
			_nLastValue = _nValue;
			_nValue = _count();
		}	
	}
}